<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@taglib prefix="f" uri="/flowpage-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title><s:property value="operate"/>主表示例</title>
	<%@include file="/share/header.jsp"%>
	<s:head/>
	<f:header theme="${sessionScope.skinCon.pageSkin}"/>	
  </head>
  <body>
	  	<s:actionerror/>
	    <s:form  action="save" namespace="/demo/father" validate="true" focusElement="domain.name">
	    	<s:hidden name="domain.id"/>
	    	<s:textfield label="姓名" id="name" name="domain.name" readonly="%{readonly}" required="true" dataType="Limit" max="100"  watermark="请输入中文姓名"/>
	    	<s:radio label="性别" name="domain.sex" noborder="true" readonly="%{readonly}" disabled="%{disabled}" required="true" list="getCodeItemList('sex')"  listKey="value" listValue="name"/>
	    	<s:textfield label="出生日期" name="domain.birthday"  readonly="%{readonly}" disabled="%{disabled}" required="true"  dataType="Date" nullValue="null">
		    	<s:param name="value">
		    		<s:date name="domain.birthday" format="yyyy-MM-dd"/>
		    	</s:param>
	    	</s:textfield>
	    	<s:textfield label="年龄" name="domain.age" readonly="%{readonly}" disabled="%{disabled}" required="true" dataType="Integer" max="150" min="1" nullValue="0"/>	    	
			<s:select label="状态" id="state" name="domain.state" cssClass="combox" emptyOption="true"  editSelect="%{(right.size==0||right.editSelectRight==1)&&!readonly?'resource_grade':''}"  readonly="%{readonly}" disabled="%{disabled}" required="true" list="getCodeItemList('demo_state')"  listKey="value" listValue="name"/>	    		    	
	    	<s:textarea label="备注" name="domain.remark"   readonly="%{readonly}" disabled="%{disabled}" multipleheight="3" multiplewidth="2"  dataType="Limit" max="2000" watermark="此处填写备注信息"/>
	    	<f:fieldset title="操作意见">
				<s:select label="操作" id="state" name="nextActivityId" cssClass="combox" emptyOption="true"  multiplewidth="2"   editSelect="%{(right.size==0||right.editSelectRight==1)&&!readonly?'resource_grade':''}"  readonly="%{readonly}" disabled="%{disabled}" required="true" list="getCodeItemList('demo_state')"  listKey="value" listValue="name+'('+value+')'"/>	    		    	
		    	<s:textarea label="意见" name="processLog.operateOpinion" required="true"    readonly="%{readonly}" disabled="%{disabled}" multipleheight="3" multiplewidth="2"  dataType="Limit" max="2000" watermark="请填写操作意见"/>
				<iframe src="<s:url action="list" namespace='/basic/processlog'/>?domainClass=<s:property value="domainClass.name"/>&domainId=<s:property value="domain.id"/>"  class="ItemIframe" frameborder="0"></iframe>	    	
			</f:fieldset>
	    	<s:if test="!readonly">
	    		<iframe src="<s:url action="list" namespace='/demo/child'/>?readonly=<s:property value="readonly"/>&actionName=<s:property value="actionClass.name"/>&manyPropertyName=childs&onePropertyName=father"  class="ItemIframe" frameborder="0"></iframe>
	    		<br/>
	    		<br/>
	    		<iframe src="<s:url action="list" namespace='/basic/documentsupload'/>?readonly=<s:property value="readonly"/>&actionName=<s:property value="actionClass.name"/>&parentId=<s:property value="domain.id"/>&fileExtensionStr=1,2,3,4&&businessType=<s:property value="actionClass.name"/>"  class="ItemIframe" frameborder="0"></iframe>
	    	</s:if>
	    	<s:else>	    	
				<div class="EasyTabs">
				  <div class="EasyMenuBox">
				    <ul class="EasyMenu">
				      <li index="1" class="hover" onclick="EasyTabs.setTab(this)" title="申请明细">申请明细</li>
				      <li index="2" onclick="EasyTabs.setTab(this)" title="审核明细">审核明细</li>
				    </ul>
				  </div>
				  <div class="EasyMainBox">
				  	<div class="EasyMain">
					   <ul index="1" class="block">
						   <li>
						   	<iframe src="<s:url action="list" namespace='/demo/child'/>?readonly=<s:property value="readonly"/>&actionName=<s:property value="actionClass.name"/>&manyPropertyName=childs&onePropertyName=father"  class="ItemIframe" frameborder="0"></iframe>
						   </li>
					   </ul>
					   <ul index="2">
						   <li>
						   	<iframe src="<s:url action="list" namespace='/demo/child'/>?readonly=<s:property value="readonly"/>&actionName=<s:property value="actionClass.name"/>&manyPropertyName=childs&onePropertyName=father"  class="ItemIframe" frameborder="0"></iframe>
						   </li>
					   </ul>
					</div>
				  </div>
				  
				</div>	
	    	</s:else>					
	    </s:form>
  </body>
  <script>
        //initialize-submit callback 
		function initializeSubmit(parameters){
			if(parameters.action==top.MyWindow.Save.action){ 
				//document.getElementById("name").value="测试";
			}
			return true;
		}
		
		//xl 2012-05-22 保存不关闭，重写postSubmit方法
		function postSubmit(parameters){
	    		var result=top.MyWindow.defaultPostSubmit(parameters);
	    		if(result && parameters.action==top.MyWindow.SaveNoClose.action){//保存
	    			return false;
	    		}
	    		return result;
	    	}
  </script>  
 
</html>
